<?php
class Products_Model extends General_Model {

	var $_table = 'products';

	function getList($type) {
		$list = $this->getItemList($this->_table, array('field' => 'type', 'type'=>$type));		
		return $list;
	}

	function getDetail($id) {
		$detail = $this->getItemDetail($this->table,array('field' => 'id', 'id' => $id));
		return $detail;
	}

	function save($item=array(),$data=array()){
		$id = $this->saveItem($this->_table,$item,$data);
		return $id;
	}

	function del($id) {
		$rs = $this->deleteItem($this->_table,array('id'=>$id));
		return $rs;
	}
}